﻿//
// Created by LiuYou on 2021/4/19.
//

#include <utility>
#include <iostream>
#include <vector>
#include <tuple>

void tupleTest() {
    std::tuple<int, int, double> tuple(1, 199, 4.4);
    std::cout << std::get<0>(tuple) << std::endl;
    std::cout << std::get<1>(tuple) << std::endl;
    std::cout << std::get<2>(tuple) << std::endl;
}

void testHashFunction() {
    std::cout << std::hash<int>()(123) << std::endl;

}

void testLibrary() {
    int a = 100;
    int b = 1;
    // 标准库的swap有好几个版本。其中有一个是交换两个对象的内存。
    std::swap(a, b);
    std::cout << "a: " << a << std::endl
              << "b: " << b << std::endl;

    std::vector<int> vectorInteger({1, 2, 3, 4, 5, 671, 3, 32});
    for (const auto& item : vectorInteger) {
        std::cout << item << std::endl;
    }
}


int main() {
//    testLibrary();
//    testHashFunction();
    tupleTest();


    return 0;
}

